import request from '@/utils/request'
import upload from '@/utils/upload.js'
// 查询车辆列表
export const getCarList = (data) => {
	return request({
		url: '/app/vehicle/getDriverVehiclePage',
		method: 'post',
		data
	})
}

// 查询车辆类型
export const getCarType = () => {
	return request({
		url: '/dict/getCarType',
		method: 'post'
	})
}

// 查询车辆颜色
// 导出一个函数，用于获取汽车颜色
export const getCarColor = () => {
	return request({
		url: '/dict/getCarColor',
		method: 'post'
	})
}

// 查询车辆能源类型
export const getCarEnergy = () => {
	return request({
		url: '/dict/getCarEnergyType',
		method: 'post'
	})
}

// 添加车辆
export const addCar = (data) => {
	return request({
		url: '/app/vehicle/saveVehicle',
		method: 'post',
		data
	})
}

// 获取车辆信息
export const getCarInfo = (data) => {
	return request({
		url: '/app/vehicle/getVehicle',
		method: 'post',
		data
	})
}

// 修改车辆
export const editCar = (data) => {
	return request({
		url: '/app/vehicle/updateVehicle',
		method: 'post',
		data
	})
}